using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using System.IO.Ports;
using System.Text;

#if MINI
using SecretLabs.NETMF.Hardware.NetduinoMini;
#else
using SecretLabs.NETMF.Hardware.Netduino;
#endif

namespace codebase
{
    public class Window0 : UI.Window
    {
        UI.Frame Frame0;
        UI.Button Button0;
        UI.Button Button1;
        UI.Button Button2;
        UI.Button Button3;

        public Window0(UI.WindowManager win)
        {
            Initialize(win);
        }

        public void Initialize(UI.WindowManager man)
        {
            base.Initialize(man, 0, 0);
            Text = "Mini Window";

            Visible = true;
            FullScreen = true;
            Width = 128;
            Height = 128;
            DrawBorder = true;
            CaptionColor = ColorExtensions.RGB16(105, 105, 105);

            Frame0 = (UI.Frame)Add(UI.Window.ControlTypes.Frame, 1, 2);
            Frame0.Text = "Buttons!";
            Frame0.Width = 112;
            Frame0.Height = 104;
            Frame0.BackgroundColor = ColorExtensions.RGB16(85, 107, 47);

            Button0 = (UI.Button)Add(UI.Window.ControlTypes.Button, 2, 4);
            Button0.Text = "ALARM!";
            Button0.isStateButton = false;
            Button0.Width = 98;
            Button0.Height = 32;
            Button0.BackgroundColor = ColorExtensions.RGB16(85, 107, 47);
            Button0.NotPressedColor = ColorExtensions.RGB16(173, 216, 230);

            Button1 = (UI.Button)Add(UI.Window.ControlTypes.Button, 2, 8);
            Button1.Text = "1";
            Button1.isStateButton = false;
            Button1.Width = 28;
            Button1.Height = 48;
            Button1.BackgroundColor = ColorExtensions.RGB16(85, 107, 47);
            Button1.BorderColor = ColorExtensions.RGB16(128, 0, 0);
            Button1.NotPressedColor = ColorExtensions.RGB16(240, 128, 128);

            Button2 = (UI.Button)Add(UI.Window.ControlTypes.Button, 7, 9);
            Button2.Text = "2";
            Button2.isStateButton = false;
            Button2.Width = 28;
            Button2.Height = 32;
            Button2.BackgroundColor = ColorExtensions.RGB16(192, 255, 192);
            Button2.Padding = 5;

            Button3 = (UI.Button)Add(UI.Window.ControlTypes.Button, 12, 8);
            Button3.Text = "3";
            Button3.isStateButton = false;
            Button3.Width = 28;
            Button3.Height = 48;
            Button3.BackgroundColor = ColorExtensions.RGB16(85, 107, 47);
            Button3.BorderColor = ColorExtensions.RGB16(25, 25, 112);
            Button3.NotPressedColor = ColorExtensions.RGB16(255, 192, 203);
        }
    }
}
